package cn.chengpengper.shortlink.service.impl;

import cn.chengpengper.shortlink.component.OssComponent;
import cn.chengpengper.shortlink.service.FileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author huchengpeng
 * @version v1.0.0
 * @date 2023/8/21 23:02
 * @description 文件上传服务实现
 */
@Slf4j
@Service
public class FileServiceImpl implements FileService {

    @Autowired
    private OssComponent ossComponent;

    @Override
    public String uploadUserAvatar(MultipartFile multipartFile) {
        return ossComponent.upload(multipartFile);
    }
}
